package com.jpx.jxcbiz.service.impl;

<<<<<<< HEAD
import com.alibaba.fastjson.JSON;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.CertAlipayRequest;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipayTradePrecreateRequest;
import com.alipay.api.response.AlipayTradePrecreateResponse;
import com.jpx.jxcbiz.config.alibaba.pay.PayConfig;
import com.jpx.jxcbiz.service.AlibabaPayService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
=======
import com.alipay.api.response.AlipayTradePrecreateResponse;
import com.jpx.jxcbiz.service.AlibabaPayService;
import lombok.extern.slf4j.Slf4j;
>>>>>>> 935fd3a0d6ae3757684a4c6b15491219f16ca1c2
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

<<<<<<< HEAD
import java.util.Map;
=======
>>>>>>> 935fd3a0d6ae3757684a4c6b15491219f16ca1c2
import java.util.concurrent.TimeUnit;

@Service
@Slf4j
public class AlibabaPayServiceImpl implements AlibabaPayService {


    @Autowired
    StringRedisTemplate StringRedisTemplate;

<<<<<<< HEAD

    @Override
    public String getAlibabaPayQRCode(AlipayTradePrecreateResponse qrCodePayOrder) {
        if(qrCodePayOrder!=null){
         StringRedisTemplate.opsForValue().set(qrCodePayOrder.getOutTradeNo(),qrCodePayOrder.getQrCode(),3600, TimeUnit.SECONDS);
            return StringRedisTemplate.opsForValue().get(qrCodePayOrder.getOutTradeNo());
        }
        return "存储失败";
=======
    @Override
    public String getAlibabaPayQRCode(AlipayTradePrecreateResponse qrCodePayOrder) {
        StringRedisTemplate.opsForValue().set(qrCodePayOrder.getOutTradeNo(),qrCodePayOrder.getQrCode(),3600, TimeUnit.SECONDS);
        return StringRedisTemplate.opsForValue().get(qrCodePayOrder.getOutTradeNo());
>>>>>>> 935fd3a0d6ae3757684a4c6b15491219f16ca1c2
    }
}
